Contents
DBF Structure

Apollo Code Generator

© 1997, Dave Wedwick

dwedwick@bigfoot.com

This program reads the header of existing .DBF files and creates Delphi code based on the structure of the file.  The code generated is the bulk of the work to create tables and indicies in Delphi using Apollo from SuccessWare International.  This is useful for those of us that are moving programs from other languages into Delphi.

Overview

Usage

Command Line Parameter

There are three types of output:

Code to create tables

Code to create indicies

Structure documentation

This program is provided as is.  I cannot be responsible for any unintended effects that this program may produce.

Please send comments and questions to dwedwick@bigfoot.com


Code to create tables

Delphi procedure code is generated that creates the table.  It creates the TTable, TDataSource and TApollo components.  Then, any other function in the Delphi program can simply call this procedure.


Code to create indicies

Delphi procedure code is produced that does everything except fill in the index keys, conditions, etc.  The job is then reduced to just filling in the specific index information.


Structure documentation

The output is simply a listing of the fields, types, widths, and decimals of the table.  It may be useful for program documenatation.  This is not Delphi code.


Overview

The philosophy here is, when distributing a program, if the tables and indicies dont exist, the program should create them.  Also, it is very common to have, as part of a maintenance section, an option to re-create the indicies.  This program creates the code to create and index the table.

The output may not be exactly what everyone would write (a matter of style).  But, I feel it is easier to remove code than to add it.  So, there may be more than what is needed in every situation.  But, the tedious parts are somewhat automated.


Usage

To use, simply select the drive, directory and file (.DBF extension is assumed) from the left side of the window -- the contents of the file appears on the right side of the window.  Then, at the bottom, left, use the comboboxes to select the output type and click on Copy to Clipboard.  After that, just paste from the clipboard into the code editor.  Double clicking on a table name will produce a window showing more information about the tables header.


Command Line Parameter

This program takes a drive/path as the optional command line parameter.  If passed, the program will start there when looking for tables.

This program can be added to Delphis Tools (pulldown menu option).  By using the Tools macros, you can also specifiy in which subdirectory to start.

An example is to have the program start in the same directory as the project by using the macro $PATH($EDNAME) in the Parameters edit box.